#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QTcpSocket>
#include <QTcpServer>
#include <QHostAddress>
#include "pack.h"
#include <QMessageBox>
#include "userinterface.h"
#include "udproom.h"


QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();
    bool regist_back(Pack pack);
    bool login_back(Pack pack);
    bool create_room_back(Pack pack);
    void join_room_back(Pack pack);


private slots:
    void on_pushButton_clicked();
    void on_pushButton_2_clicked();
    void onReadyRead();

private:
    Ui::Widget *ui;
    QTcpSocket* client;
    QString user_name;
    UserInterface* user_interface;
};
#endif // WIDGET_H
